// 策略实验室相关接口

import services from '../createServices';

// 策略实验室
export const strategyLabs = {
  list: params => services.post('/lab/list', { params, isLoading: true }),
  delete: params => services.post('/lab/delete', { params, isLoading: true }),
  detailList: params => services.post('/lab/detail', { params, isLoading: true }),
  add: params => services.post('/lab/create', { params, isLoading: true }),
  update: params => services.post('/lab/edit', { params, isLoading: true }),
  getPolicyByIds: params => services.post('/lab/strategy-list', { params, isLoading: true }),
  getTacticsLabsDetail: params => services.post('/lab/experiment-detail', { params }),
  startTest: params => services.post('/lab/start', { params, isLoading: true }),
  endTest: params => services.post('/lab/end', { params, isLoading: true }),
  getProgress: params => services.post('/lab/process', { params, isLoading: false }),
  getHitList: params => services.post('/lab/experiment-hit-detail', { params }),
  getErrorList: params => services.post('/lab/error-list', { params }),
  validate: params => services.post('/strategy/validate', { params, isLoading: true })
};

// 策略实验室新
export const strategyLabsApi = {
  list: params => services.post('/strategy-lab/lists', { params, isLoading: true }),
  delete: params => services.post('/strategy-lab/delete', { params, isLoading: true }),
  detailList: params => services.post('/strategy-lab/detail', { params, isLoading: true }),
  add: params => services.post('/strategy-lab/create', { params, isLoading: true }),
  update: params => services.post('/strategy-lab/edit', { params, isLoading: true }),
  getPolicyByIds: params => services.post('/strategy-lab/quote-strategies', { params, isLoading: true }),
  validate: params => services.post('/strategy-lab/validate', { params, isLoading: true }),
  getTacticsLabsDetail: params => services.post('/strategy-lab/experiment-details', { params }),
  getHitList: params => services.post('/strategy-lab/experiment-hit-detail', { params }),
  getErrorList: params => services.post('/strategy-lab/experiment-exception-list', { params }),
  requestTrend: params => services.post('/strategy-lab/experiment-requests-trend', {params, isLoading: true}),
  startTest: params => services.post('/strategy-lab/started', { params, isLoading: true }),
  endTest: params => services.post('/strategy-lab/stopped', { params, isLoading: true }),
  getProgress: params => services.post('/strategy-lab/experiment-process', { params, isLoading: false }),
  queryOne: params =>  services.post('/strategy-lab/strategy-hit-detail', { params, isLoading: false })
}